# -*- coding: utf-8 -*-

from matplotlib import pyplot as plt

'''
气温折线图
'''

# 设置图片大小
plt.figure(figsize=(20, 8), dpi=50)

# 数据
x = range(2, 26, 2)
y = [15, 13, 14.5, 17, 20, 25, 26, 26, 27, 22, 18, 15]

# 设置x轴刻度
plt.xticks(range(2, 26, 2))
# 设置y轴刻度
_y_labels = [i for i in range(min(y), max(y) + 1)]
plt.yticks(_y_labels)

# 绘图
plt.plot(x, y)

# 保存图片
plt.savefig("./hello.png")
# 展示
plt.show()
